#pragma once
#include <Rz/Object.h>
#include <Rz/Memory.h>
#include "Vector3.h"
#include "Matrix4.h"
#include "BoundingSphere.h"

namespace Rz { namespace Graphics { namespace Math {

class BoundingBox :
	public Object
{
	public:
		RZ_RTTI(Rz::Graphics, BoundingBox);
		RZ_RTTI_IMPLEMENTS(Object);
		RZ_RTTI_END;

		Vector3 Position;
		Vector3 Extend;

		static const BoundingBox Empty;

		static BoundingBox FromMinMax(const Vector3& min, const Vector3& max);
		
		Vector3 GetMinimum() const;
		Vector3 GetMaximum() const;
		
		BoundingBox operator + (const BoundingBox& aabb) const;
		BoundingBox operator * (float scale) const;
		
		void Transform(const Matrix4& matrix);
		
		void GetCornerPoints(Vector3* points) const;
		BoundingSphere GetBoundingSphere() const;
};

} } }
